package com.lineage.data.item_etcitem.add;

import com.lineage.data.executor.ItemExecutor;
import com.lineage.server.model.Instance.L1ItemInstance;
import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.serverpackets.S_ServerMessage;
import com.lineage.server.serverpackets.ServerBasePacket;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class tfcount extends ItemExecutor {
  private static final Log _log = LogFactory.getLog(tfcount.class);
  
  private int _count = 0;
  
  public static ItemExecutor get() {
    return new tfcount();
  }
  
  public void execute(int[] data, L1PcInstance pc, L1ItemInstance item) {
    if (this._count == 0)
      return; 
    if (item == null)
      return; 
    if (pc == null)
      return; 
    pc.getInventory().removeItem(item, 1L);
    pc.get_other2().set_TfCount(pc.get_other2().get_TfCount() + this._count);
    pc.sendPackets((ServerBasePacket)new S_ServerMessage("\\aD目前总天赋:" + pc.get_other2().get_TfCount()));
  }
  
  public void set_set(String[] set) {
    try {
      this._count = Integer.parseInt(set[1]);
    } catch (Exception exception) {}
  }
}
